﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Data;

namespace TooltracePC
{
    class dbConfig : clsDatabase
    {
        private static int nCfgCount = 0;

        public int getCfgCount()
        {
            if (nCfgCount > 0)
            {
                return nCfgCount;
            }
            setCfgCount();
            return nCfgCount;
        }

        private void setCfgCount()
        {
            string strSql = @"select count(*) AS c from Configs";
            DataTable dtTool = null;
            dtTool = SelectToDataTable(strSql);
            nCfgCount = (int)dtTool.Rows[0]["c"];
        }


        public DataTable getAll()
        {
            string strSql = @"select * from Configs";
            DataTable dtTool = null;
            dtTool = SelectToDataTable(strSql);

            return dtTool;
        }

    }
}
